<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
	<div class="modal modal-flex fade" id="modalCreate" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Đóng</span>
					</button>
					<h4 class="modal-title" id="adminRegisterModalLabel">Tạo mới</h4>
				</div>
				<form role="form" action="create" id="adminRegisterForm">
				<div class="modal-body">
					<div class="portlet-body">
					<div class="mb10 input-group">
						<span class="input-group-addon">Họ tên&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;
						</span> <input type="text"
							class="form-control" placeholder="Fullname" name="fullname" required>
					</div>
					<div class="mb10 input-group">
						<span class="input-group-addon">Tên đăng nhập
							&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;</span> <input type="text" id="txtAccount"
							onfocus=""
							class="form-control" placeholder="Name" name="username" autocomplete="off" required>
					</div>
					<div class="mb10 input-group">
						<span class="input-group-addon">Mật khẩu&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
							&nbsp; &nbsp; &nbsp; &nbsp;</span> <input type="password"
							id="cp1" name='password' class="form-control"
							placeholder="Password" required>
					</div>
					<div class="mb10 input-group">
						<span class="input-group-addon">Xác nhận mật khẩu</span> <input
							type="password" class="form-control" id="cp2"
							onfocus="cvalidatePass(document.getElementById('cp1'), this);"
							oninput="cvalidatePass(document.getElementById('cp1'), this);"
							placeholder="Confirm password" name="confirmpassword"
							required>
					</div>
					<div class="mb10 input-group">
						<span class="input-group-addon">Quyền &nbsp; &nbsp; &nbsp;&nbsp;
							&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span> <select
							class="form-control" name='roleId'>
							<option value="1">Nhân viên bán hàng</option>
							<option value="2">Quản lý thuốc</option>
							<option value="3">Chủ cửa hàng</option>
							<option value="5">Cung cấp dịch vụ</option>
						</select>
					</div>
					<div class="mb10 input-group">
						<span class="input-group-addon">Quầy thuốc&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;
							&nbsp; &nbsp; &nbsp;</span> <select class="form-control" name='storeId'>
							<c:forEach var="store" items="${stores}">
								<option value="${store.getId()}">${store.getStoreName()}</option>
							</c:forEach>
						</select>
					</div>
					<div class="input-group">
						<span class="input-group-addon">Email&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp; &nbsp; &nbsp;</span> <input type="text" class="form-control"
							placeholder="Name" name="email">
					</div>
				</div>
				</div>
				<div class="modal-footer">
					<button type="submit" class="btn btn-primary btn-square">Lưu</button>
					<button type="button" class="btn btn-default btn-square" data-dismiss="modal">Đóng</button>
				</div>
				</form>
			</div>
		</div>
	</div>
<script>
function cvalidatePass(cp1, cp2) {
	
	    if (cp1.value != cp2.value || cp1.value == '' || cp2.value == '') {
	
	        cp2.setCustomValidity('Confirm Password incorrect');
	
	    } else {
	
	        cp2.setCustomValidity('');
	
	    }
	
	}
function checkValidate(){
	var account = document.getElementById("txtAccount").value;
	
}
</script>